#!/bin/sh
while true; do
  LEAVES=`pkg_cutleaves -l -x | xargs`
  if [ -z "$LEAVES" ]; then
    exit
  else
    echo "Deinstalling $LEAVES"
    pkg_deinstall $LEAVES
  fi
done
